package com.zyl.pts.config.validated;

import com.zyl.pts.config.anno.DrStatus;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @version v1.0
 * @ProjectName: product_source
 * @Package: com.zyl.pts.config.validated
 * @ClassName: DrStatusValidated
 * @Description TODO()
 * @Author 翟玉龙
 * @Date 2024/11/22-15:05
 */
public class DrStatusValidated implements ConstraintValidator<DrStatus, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        if(s.isEmpty()) {
            return true;
        }
        return "未治疗".equals(s) ||
                "治疗中".equals(s) ||
                "已治疗".equals(s) ;
    }
}
